package searcher.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import searcher.Searcher;
import bean.Grass;

public class Search extends HttpServlet {
		
	private static final long serialVersionUID = 8713920291266787195L;

	public Search() {
		super();
	}

	public void destroy() {
		super.destroy(); 		
	}
	
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		
		String keyword=new String(request.getParameter("keyword").getBytes("ISO-8859-1"),"UTF-8");
	
		Searcher ser=new Searcher();
		
		List<Grass> list=ser.search(keyword);
		request.setAttribute("result", list);
		
		request.getRequestDispatcher("result/result.jsp").forward(request, response); 

	}	
	
}
